package com.project.service;

import com.project.dao.IUserDao;
import com.project.dao.impl.UserDaoImpl;
import com.project.server.Request;
import com.project.server.Response;
import com.project.server.Servlet;
import com.project.server.WebServlet;

/**
 * 删除业务组件
 */
@WebServlet("del")
public class DelService implements Servlet {
    private IUserDao userDao = new UserDaoImpl();

    public void service(Request request, Response response){
        //得到表单数据
        int id = Integer.parseInt(request.getParameter("id"));

        //调用持久方法，完成删除
        userDao.del(id);
        FindAllService findAllService = new FindAllService();
        findAllService.service(request,response);
    }
}
